/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package banco_imobiliario.view;

import banco_imobiliario.control.ControladorInterface;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.Action;
import javax.swing.Timer;

/**
 *
 * @author Andre
 */
public class LogoMarcas extends javax.swing.JFrame implements ActionListener {

    Timer tm = new Timer(5, this);
    private ControladorInterface controlInterface = ControladorInterface.getInstancia();
    /**
     * Creates new form LogoMarcas
     */
    public LogoMarcas() {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SelecionarJogadoresUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        initComponents();
        BufferedImage image = null;
        File imageFile = new File(".\\src\\banco_imobiliario\\imagens\\icone.png");
        try {
            image = ImageIO.read(imageFile);

        } catch (IOException ex) {
        }

        this.setIconImage(image);
        jP_logo_empresa.setVisible(false);
        jP_logo_jogo.setVisible(false);
        
        Thread thread = new ThreadBasica1();
        thread.start();




    }

    class ThreadBasica1 extends Thread {
        // Este método(run()) é chamado quando a thread é iniciada

        @Override
        public void run() {
            jP_logo_empresa.setVisible(true);
            try {
                sleep(4000);
            } catch (InterruptedException ex) {
                Logger.getLogger(LogoMarcas.class.getName()).log(Level.SEVERE, null, ex);
            }

            controlInterface.iniciarEscolhaDePersonagens();
            dispose();
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jP_logo_jogo = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jP_logo_empresa = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Banco Imobiliário");

        jP_logo_jogo.setBackground(new java.awt.Color(0, 0, 0));

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/banco_imobiliario/imagens/logo.png"))); // NOI18N
        jLabel2.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 51, 153)));

        javax.swing.GroupLayout jP_logo_jogoLayout = new javax.swing.GroupLayout(jP_logo_jogo);
        jP_logo_jogo.setLayout(jP_logo_jogoLayout);
        jP_logo_jogoLayout.setHorizontalGroup(
            jP_logo_jogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 784, Short.MAX_VALUE)
        );
        jP_logo_jogoLayout.setVerticalGroup(
            jP_logo_jogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
        );

        jP_logo_empresa.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/banco_imobiliario/imagens/anigif.gif"))); // NOI18N
        jLabel1.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jP_logo_empresaLayout = new javax.swing.GroupLayout(jP_logo_empresa);
        jP_logo_empresa.setLayout(jP_logo_empresaLayout);
        jP_logo_empresaLayout.setHorizontalGroup(
            jP_logo_empresaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 784, Short.MAX_VALUE)
        );
        jP_logo_empresaLayout.setVerticalGroup(
            jP_logo_empresaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jP_logo_empresa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jP_logo_jogo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jP_logo_empresa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jP_logo_jogo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-800)/2, (screenSize.height-606)/2, 800, 606);
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {

        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new LogoMarcas().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jP_logo_empresa;
    private javax.swing.JPanel jP_logo_jogo;
    // End of variables declaration//GEN-END:variables

    @Override
    public void actionPerformed(ActionEvent e) {
    }
}
